import request from '@/config/axios'

export interface FollowUpVO {
  id: number
  leadsId: number
  content: string
  type: string
  notes: string
  creatorId: number
  creatorName: string
  creatorDeptId: number | null
  createTime: number
}

export interface CreateFollowUpReqVO {
  leadsId: number
  content: string
  type: string
  notes: string
}

/** 跟进记录 API 地址 */
const API = {
  List: '/weiyi/leads-follow-up/page',
  Create: '/weiyi/leads-follow-up/create'
}

/** 获取跟进记录列表 */
export const getFollowUpList = (leadsId: number) => {
  return request.get<{
    list: FollowUpVO[]
    total: number
  }>({ 
    url: '/weiyi/leads-follow-up/page',
    params: {
      pageNo: 1,
      pageSize: 100,
      leadsId
    }
  })
}

/** 创建跟进记录 */
export const createFollowUp = (data: CreateFollowUpReqVO) => {
  return request.post({ 
    url: '/weiyi/leads-follow-up/create',
    data
  })
} 